/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jili.ubert.dao.trace;

import java.io.Serializable;
import com.baidu.bjf.remoting.protobuf.Codec;
import com.baidu.bjf.remoting.protobuf.ProtobufProxy;
import com.baidu.bjf.remoting.protobuf.annotation.Protobuf;
import com.jili.ubert.code.CodeTool;
import java.io.IOException;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author dragon
 */
@Entity
@Table(name = "trace_account_icode")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "TraceAccountIcode.findAll", query = "SELECT t FROM TraceAccountIcode t"),
    @NamedQuery(name = "TraceAccountIcode.findBySid", query = "SELECT t FROM TraceAccountIcode t WHERE t.sid = :sid"),
    @NamedQuery(name = "TraceAccountIcode.findByTraceType", query = "SELECT t FROM TraceAccountIcode t WHERE t.traceType = :traceType"),
    @NamedQuery(name = "TraceAccountIcode.findById", query = "SELECT t FROM TraceAccountIcode t WHERE t.id = :id"),
    @NamedQuery(name = "TraceAccountIcode.findByIid", query = "SELECT t FROM TraceAccountIcode t WHERE t.iid = :iid"),
    @NamedQuery(name = "TraceAccountIcode.findByInvestID", query = "SELECT t FROM TraceAccountIcode t WHERE t.investID = :investID"),
    @NamedQuery(name = "TraceAccountIcode.findByType", query = "SELECT t FROM TraceAccountIcode t WHERE t.type = :type"),
    @NamedQuery(name = "TraceAccountIcode.findByCode", query = "SELECT t FROM TraceAccountIcode t WHERE t.code = :code"),
    @NamedQuery(name = "TraceAccountIcode.findByAlterUserID", query = "SELECT t FROM TraceAccountIcode t WHERE t.alterUserID = :alterUserID"),
    @NamedQuery(name = "TraceAccountIcode.findByCreateTime", query = "SELECT t FROM TraceAccountIcode t WHERE t.createTime = :createTime"),
    @NamedQuery(name = "TraceAccountIcode.findByTimeStamp", query = "SELECT t FROM TraceAccountIcode t WHERE t.timeStamp = :timeStamp")})
public class TraceAccountIcode implements Serializable {
	public static byte[] EnCode(TraceAccountIcode msg) throws IOException {
		Codec<TraceAccountIcode> Lcode = ProtobufProxy.create(TraceAccountIcode.class);
		return Lcode.encode(msg);
	}
	public static TraceAccountIcode DeCode(byte[] data) throws IOException {
	Codec<TraceAccountIcode> Lcode = ProtobufProxy.create(TraceAccountIcode.class);
		return Lcode.decode(data);
	}

    private static final long serialVersionUID = 1L;
    @Id
    //@GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "sid")
    @Protobuf
	private Integer sid;
    @Basic(optional = false)
    @Column(name = "TraceType")
    @Protobuf
	private String traceType;
    @Basic(optional = false)
    @Column(name = "id")
    @Protobuf
	private int id;
    @Basic(optional = false)
    @Column(name = "iid")
    @Protobuf
	private int iid;
    @Basic(optional = false)
    @Column(name = "InvestID")
    @Protobuf
	private String investID;
    @Basic(optional = false)
    @Column(name = "Type")
    @Protobuf
	private String type;
    @Basic(optional = false)
    @Column(name = "Code")
    @Protobuf
	private String code;
    @Column(name = "AlterUserID")
    @Protobuf
	private String alterUserID;
    @Column(name = "CreateTime")
    @Temporal(TemporalType.TIMESTAMP)
    private Date createTime;
	//@Protobuf
//tprivate long createTimeL;
    @Column(name = "TimeStamp")
    @Temporal(TemporalType.TIMESTAMP)
    private Date timeStamp;
	//@Protobuf
	//private long timeStampL;

    public TraceAccountIcode() {
    }

    public TraceAccountIcode(Integer sid) {
        this.sid = sid;
    }

    public TraceAccountIcode(Integer sid, String traceType, int id, int iid, String investID, String type, String code) {
        this.sid = sid;
        this.traceType = traceType;
        this.id = id;
        this.iid = iid;
        this.investID = investID;
        this.type = type;
        this.code = code;
    }

    public Integer getSid() {
        return sid;
    }

    public void setSid(Integer sid) {
        this.sid = sid;
    }

    public String getTraceType() {
        return traceType;
    }

    public void setTraceType(String traceType) {
        this.traceType = traceType;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getIid() {
        return iid;
    }

    public void setIid(int iid) {
        this.iid = iid;
    }

    public String getInvestID() {
        return investID;
    }

    public void setInvestID(String investID) {
        this.investID = investID;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getAlterUserID() {
        return alterUserID;
    }

    public void setAlterUserID(String alterUserID) {
        this.alterUserID = alterUserID;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
		//this.createTimeL = CodeTool.DateToLong(createTime);
    }

    public Date getTimeStamp() {
        return timeStamp;
    }

    public void setTimeStamp(Date timeStamp) {
        this.timeStamp = timeStamp;
		//this.timeStampL = CodeTool.DateToLong(timeStamp);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (sid != null ? sid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TraceAccountIcode)) {
            return false;
        }
        TraceAccountIcode other = (TraceAccountIcode) object;
        if ((this.sid == null && other.sid != null) || (this.sid != null && !this.sid.equals(other.sid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.jili.ubert.dao.trace.TraceAccountIcode[ sid=" + sid + " ]";
    }
    
}
